import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        //编程题
        //提示用户输入年月日信息，判断这一天是这一年中的第几天并打印。
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入年份");
        int year = sc.nextInt();
        System.out.println("请输入月份");
        int month = sc.nextInt();
        System.out.println("请输入今天是几号");
        int date = sc.nextInt();
        int day = 0;
        //判断是否是闰年
        boolean isLeapYear = (year%4==0&&year%100!=0)||(year%400==0);
        if (isLeapYear){
            switch (month){
                case 1:day=date;break;
                case 2:day=date+31;break;
                case 3:day=29+31+date;break;
                case 4:day=29+31+31+date;break;
                case 5:day=29+31+31+30+date;break;
                case 6:day=29+31+31+30+31+date;break;
                case 7:day=29+31+31+30+31+30+date;break;
                case 8:day=29+31+31+30+31+30+31+date;break;
                case 9:day=29+31+31+30+31+30+31+31+date;break;
                case 10:day=29+31+31+30+31+30+31+31+30+date;break;
                case 11:day=29+31+31+30+31+30+31+31+30+31+date;break;
                case 12:day=29+31+31+30+31+30+31+31+30+31+30+date;break;
            }

        }else{
            switch (month){
                case 1:day=date;break;
                case 2:day=31+date;break;
                case 3:day=28+31+date;break;
                case 4:day=28+31+31+date;break;
                case 5:day=28+31+31+30+date;break;
                case 6:day=28+31+31+30+31+date;break;
                case 7:day=28+31+31+30+31+30+date;break;
                case 8:day=28+31+31+30+31+30+31+date;break;
                case 9:day=28+31+31+30+31+30+31+31+date;break;
                case 10:day=28+31+31+30+31+30+31+31+30+date;break;
                case 11:day=28+31+31+30+31+30+31+31+30+31+date;break;
                case 12:day=28+31+31+30+31+30+31+31+30+31+30+date;break;
            }
        }
        System.out.println("今年第"+day+"天");
    }
    }

